Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CBG-3913 replace parseStreamWithXattr with sg-bucket function #6812

Merged
merged 3 commits into from
May 14, 2024

Conversation

torcolvin
Copy link
Collaborator

@torcolvin torcolvin commented May 8, 2024

Depends on couchbase/sg-bucket#122 and couchbase/sg-bucket#123

  • Consolidate tests into a table driven test, these tests exist in sg-bucket too with just DecodeValueWithXattrs.
  • Replace errors with sgbucket errors and use errors.Is

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Dependencies (if applicable)

  • Link upstream PRs
  • Update Go module dependencies when merged

Integration Tests

@torcolvin
Copy link
Collaborator Author

I was thinking about changing sgbucket.DecodeValueWithXattrs to return map[string][]byte for xattr values so the caller doesn't have to loop over them again.

adamcfraser
adamcfraser previously approved these changes May 9, 2024
return nil, nil
}
return nil, err
return nil, fmt.Errorf("Could not parse DCP attachment sync data: %w", err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a functional change if the xattr isn't found. Should it be checking if value was found?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a functional change but parseXattrStreamData never returned ErrXattrNotFound. That said, I should catch ErrXattrInvalidLen though realistically this is also an error condition where we probably could consider stopping.

@adamcfraser adamcfraser merged commit 89637f4 into main May 14, 2024
30 checks passed
@adamcfraser adamcfraser deleted the CBG-3913 branch May 14, 2024 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants